Open
Conversation
- Created import script to migrate legacy assessment data from IP2M METRR Excel exports - Supports dry-run mode for preview before actual import - Imports assessments, users, responses with proper relationships - Uses database transactions for data integrity - Comprehensive documentation with Excel format specification - Added yarn import:ip2m command for easy usage - Handles new database schema with assessmentUserGroupId in responses
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new utility to import legacy IP2M METRR assessment data into EMPACT, along with configuration and documentation to support it.
- Adds a TypeScript import script (
import-ip2m-data-v2.ts) that reads Excel, validates, and imports data in a transaction - Introduces a dedicated tsconfig for scripts and updates
package.jsonto run the import viayarn import:ip2m - Provides detailed documentation (
web/scripts/README.md) and a general guidance file (CLAUDE.md)
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| web/scripts/tsconfig.json | New tsconfig for the scripts folder |
| web/scripts/import-ip2m-data-v2.ts | Import utility implementation with validation, mapping, and transactional import |
| web/scripts/README.md | Usage guide and Excel format specification |
| web/package.json | Added import:ip2m script and xlsx dependency, fixed trailing commas |
| CLAUDE.md | High-level guidance for Claude AI code interactions |
Comments suppressed due to low confidence (2)
web/scripts/import-ip2m-data-v2.ts:58
- This new import utility contains complex logic but has no automated tests. Consider adding unit or integration tests to cover data mapping, transaction flows, and error handling.
async function main() {
CLAUDE.md:1
- [nitpick] This file appears unrelated to the IP2M import utility and may introduce noise. Consider moving it to a separate PR or clearly marking its scope.
# CLAUDE.md
- Replace custom HTML tag removal with sanitize-html library - Fixes incomplete multi-character sanitization vulnerability - Move sanitize-html to devDependencies as it's only used in scripts
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This PR adds a utility to import legacy assessment data from the IP2M METRR system into EMPACT. The utility reads Excel exports from the legacy system and creates all necessary records in EMPACT while preserving data integrity.
Features
Usage
Import Results
Successfully imported test data:
Implementation Notes
See
web/scripts/README.mdfor complete documentation including Excel format specification.